home *** CD-ROM | disk | FTP | other *** search
/ Nikkei Mac 20 / NIKKEI-MAC-CD-VOL-20-1998-12.ISO.7z / NIKKEI-MAC-CD-VOL-20-1998-12.ISO / オンラインソフト / 9.ウェブ作成ツール / PageSpinner / Pagespin-ext-pack-201j.sit / PageSpinner 2.01 Ext Pack r1 Jp / New Extensions / JavaScript Events.rsrc / TEXT_214.txt < prev   
Text File  |  1997-10-05  |  2KB  |  22 lines

  1. What are Event Handlers and what are they good for?
  2.  
  3. In JavaScript you can write functions that perform various actions. If you place a call to the function inside a page, the function is performed when that section of the page is loaded and displayed by the browser.
  4.  
  5. To be able to start functions and perform actions written in JavaScript after a page has loaded, event handlers can be used. Event handlers are specified inside the start tag for several of the HTML tags that are represented as JavaScript objects. These objects can be programmed to perform cool or just useful actions.
  6.  
  7. An event is basically an action that is performed by either the user, e.g. when the user clicks upon a button, or automatically generated when e.g., a page has loaded. These actions, or events as they are called by programmers, are reported by the browser to the JavaScripts objects in a page.
  8.  
  9. If you want to know when a specific event has occured you simply add an event handler inside the start tag of the object. For a button object in a form, you could add the following event handler:
  10.  
  11.             onClick="showGreeting()"
  12.  
  13. Whenever the user clicks upon the button, your function with the name "showGreeting", written by you and placed in the HEAD section of the page, is automatically performed.
  14.  
  15. How to use:
  16.  
  17. Use this summary to find out which tags, or JavaScript Objects, that have support for specific event handlers.
  18.  
  19. You can then select the appropriate onXXXXX() function call and use the Copy command available in the Edit menu to copy the function. Place the cursor inside the start tag for the object where you want a function to be called when a certain event occurs. Select Paste from the Edit menu to insert the call. Finally enter the name of your function.
  20.  
  21. If you have installed the "JavaScript Event Handlers" menu extension in PageSpinner's Extensions folder, you can also select the different event handlers directly from a sub menu or floating menu palette available in the Tags menu.
  22.